package com.gollum.jpa.common;

import com.gollum.jpa.enums.SuperQueryMatch;

import java.util.Arrays;
import java.util.List;

/**
 * 定义高级查询对应参数

 * @author Herther
 * @version 1.0.0
 * @ClassName SuperQueryCustom.java
 * @createTime 2022年07月17日 14:27:00
 */

public class SuperQueryCustom {

   // {
   //     "superQueryMatch": AND 或者 OR
   //     “superQuerySorted”: "字段_RULE,字段_RULE"
   //     "superQueryParams": [{},{},{}]
   //     "superQueryFields":["字段1","字段2","字段3","字段n"]
   // }
   // 查询规则

    /** 连接条件枚举类型 and 或者 or **/
    private SuperQueryMatch superQueryMatch;

    ///** 排序规则  字段_desc,字段_asc **/
    //private String superQuerySorted;

    /** 查询参数 **/
    private List<SuperQueryParams> superQueryParams;

    /** 查询字段 **/
    private String[] superQueryFields;

    @Override
    public String toString() {
        return "SuperQueryCustom{" +
                "superQueryMatch=" + superQueryMatch +
                //", superQuerySorted='" + superQuerySorted + '\'' +
                ", superQueryParams=" + superQueryParams +
                ", superQueryFields=" + Arrays.toString(superQueryFields) +
                '}';
    }

    public SuperQueryMatch getSuperQueryMatch() {
        return superQueryMatch;
    }

    public SuperQueryCustom setSuperQueryMatch(SuperQueryMatch superQueryMatch) {
        this.superQueryMatch = superQueryMatch;
        return this;
    }

    //public String getSuperQuerySorted() {
    //    return superQuerySorted;
    //}
    //
    //public SuperQueryCustom setSuperQuerySorted(String superQuerySorted) {
    //    this.superQuerySorted = superQuerySorted;
    //    return this;
    //}

    public List<SuperQueryParams> getSuperQueryParams() {
        return superQueryParams;
    }

    public SuperQueryCustom setSuperQueryParams(List<SuperQueryParams> superQueryParams) {
        this.superQueryParams = superQueryParams;
        return this;
    }

    public String[] getSuperQueryFields() {
        return superQueryFields;
    }

    public SuperQueryCustom setSuperQueryFields(String[] superQueryFields) {
        this.superQueryFields = superQueryFields;
        return this;
    }
}
